package com.karaoke.oksrv.controller

import com.github.pagehelper.PageInfo
import com.karaoke.oksrv.domain.DataDictionary
import com.karaoke.oksrv.domain.Song
import com.karaoke.oksrv.service.SongService
import com.karaoke.oksrv.domain.QSong
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

/**
 * Created by allen on 2017/4/18.
 */
@RestController
@RequestMapping("/api/v1/song")
class SongController
{
    @RequestMapping(method = arrayOf(RequestMethod.POST), value = "/songs")
    fun getSongs(@RequestBody qSong: QSong): PageInfo<Song> = songService.getSongs(qSong)

    @RequestMapping(value = "/bang/news", method = arrayOf(RequestMethod.GET))
    fun getNewSongs() = songService.getNewSongs()

    @RequestMapping(value = "/bang/hots", method = arrayOf(RequestMethod.GET))
    fun getHotSongs() = songService.getHotSongs()

    @RequestMapping(value = "/bang/recommends", method = arrayOf(RequestMethod.GET))
    fun getRecommends() = songService.getRecommends()


    @Autowired lateinit var songService: SongService
}